	@include("user.head")
	<!-- 公共头部 -->

<div class="wrapper ">
	<div class="row">
		<div class="col-xs-3">
			@include("user.uc.navigation")
		</div>
		<div class="col-xs-9">
			<div class="panel panel-default">
			  <div class="panel-heading">
			    <h3 class="panel-title">基本信息</h3>
			  </div>
			  <div class="panel-body">
			  	<div class="row">
			  		<div class="col-xs-12">
			  		</div>
			  	</div>
			  	<div class="form-horizontal">
			  		<div class="form-group">
			  			<div class="row">
			  				<div class="col-xs-6">
			  					<label class="col-xs-4 control-label">设备等级:</label>
								<div class="col-xs-5 uc_value no_padding_left">
									3
								</div>
			  				</div>
			  				<div class="col-xs-6">
			  					<label class="col-xs-4 control-label">技术等级:</label>
								<div class="col-xs-5 uc_value no_padding_left">
									3
								</div>
			  				</div>
			  			</div>
				    </div>
				    <ul class="nav nav-tabs">
					  <li class="active"><a href="#technologies" data-toggle="tab" aria-expanded="true"><span class="lb-1">人员</span></a></li>
					  <li class=""><a href="#devices" data-toggle="tab" aria-expanded="false"><span class="lb-2">设备</span></a></li>
					  <li class=""><a href="#history_project" data-toggle="tab" aria-expanded="false"><span class="lb-3">近年开展的项目</span></a></li>
					</ul>
					<div id="myTabContent" class="tab-content">
					  <div class="tab-pane fade active in" id="technologies">
						<table class="table table-striped text-center">
							<thead>
							  <td><b>姓名</b></td>
							  <td><b>性别</b></td>
							  <td><b>学历</b></td>
							  <td><b>专业</b></td>
							  <td><b>职称</b></td>
							  <td><b>操作</b></td>
							</thead>
						<tbody>
							@foreach ($profession as $value)
							<tr>
							  <td><% $value['real_name'] %></td>
							  <td>
							  	@if($value['gender'] == 1)
							  	男
							  	@else
							  	女
							  	@endif
							  </td>
							  <td><% $value['education'] %></td>
							  <td><% $value['profession'] %></td>
							  <td><% $value['job'] %></td>
							  <td>
						      	<button class="btn btn-primary doEdit" pid="<% $value['id'] %>" title="编辑">
						      		<i class="fa fa-pencil-square-o"></i>
						      	</button>
						      	<button class="btn btn-primary doDelete" pid="<% $value['id'] %>" title="删除">
						      		<i class="fa fa-trash-o"></i>
						      	</button>
							  </td>
							</tr>
							@endforeach
						</tbody>

						</table>
			  			<button class="btn btn-primary pull_left" id="add_artisan"><i class="fa fa-pencil-square-o"></i> 添 加 </button>


					  </div>
					  <div class="tab-pane fade" id="devices">
					   <table class="table table-striped text-center">
						  <thead>
						      <td><b>设备名称</b></td>
						      <td><b>设备台数</b></td>
						      <td><b>测试功能</b></td>
						      <td><b>制造商</b></td>
						      <td><b>生产日期</b></td>
						      <td><b>发布日期</b></td>
						      <td><b>操作</b></td>
						  </thead>
						  <tbody>
						  	@foreach ($device as $value)
							<tr>
							  <td><%$value['name']%></td>
							  <td><%$value['num']%></td>
							  <td><%$value['functions']%></td>
							  <td><%$value['creator']%></td>
							  <td><%noSecond($value['product_time'])%></td>
							  <td><%noSecond($value['created_at'])%></td>
							  <td>
						      	<button href="#" class="btn btn-primary edit_instrument" tid="<%$value['id']%>" title="编辑">
						      		<i class="fa fa-pencil-square-o"></i>
						      	</button>
						      	<button href="#" class="btn btn-primary delete_instrument" tid="<%$value['id']%>" title="删除">
						      		<i class="fa fa-trash-o"></i>
						      	</button>
							  </td>
							</tr>
							@endforeach
						  </tbody>
						</table>
			  			<button class="btn btn-primary pull_left" id="add_instrument"><i class="fa fa-pencil-square-o"></i> 添 加 </button>

						<div class="row text-center">
						</div>
					  </div>
						<div class="tab-pane fade" id="history_project">
					    	<table class="table table-striped text-center">
								<thead>
							        <td><b>项目名称</b></td>
							        <td><b>委托单位</b></td>
							        <td><b>起止时间</b></td>
							        <td><b>操作</b></td>
								</thead>
								<tbody>
									@foreach($history as $value)
								    <tr>
									  <td><%$value['name']%></td>
									  <td><%$value['master']%></td>
									  <td><%$value['start_time']%> - <%$value['end_time']%></td>
									  <td>
								      	<button href="#" class="btn btn-primary edit_history" hid="<%$value['id']%>" title="编辑">
								      		<i class="fa fa-pencil-square-o"></i>
								      	</button>
								      	<button href="#" class="btn btn-primary delete_history" hid="<%$value['id']%>" title="删除">
								      		<i class="fa fa-trash-o"></i>
								      	</button>
									  </td>
									</tr>
									@endforeach
								</tbody>
							</table>
							<button class="btn btn-primary pull_left" id="add_projects"><i class="fa fa-pencil-square-o"></i> 添 加 </button>
							<div class="row text-center">

							</div>
					  	</div>
					</div>
				</div>
			  </div>
			</div>
		</div>
	</div>
</div>
	@include("user.footer")
	@include("user.common")
</body>

<script type="text/javascript">
$(".doEdit").bind("click",  function(){
	var pid = $(this).attr("pid");
	window.location.href="edit_artisan?pid="+pid;
})

$(".doDelete").bind("click", function(){
	var pid = $(this).attr("pid");

	confirm("","确定要删除吗?", "", function (data){
		if(data == 1){
			$.post("edit_artisan/delete", {pid : pid}, function (data){
				if(data.success)
				{
					window.location.reload();
				}
			})
		}
	})

})


$(".edit_instrument").bind("click", function(){
	var tid = $(this).attr("tid");
	window.location.href="edit_instrument?tid="+tid;
})

$(".delete_instrument").bind("click", function(){
	var tid = $(this).attr("tid");

	confirm("","确定要删除吗?", "", function (data){
		if(data == 1){
			$.post("edit_instrument/delete", {tid : tid}, function (data){
				if(data.success)
				{
					window.location.reload();
				}
			})
		}
	})

})

$(".edit_history").bind("click", function(){
	var hid = $(this).attr("hid");
	window.location.href="edit_projects?hid="+hid;
})

$(".delete_history").bind("click", function(){
	var hid = $(this).attr("hid");

	confirm("","确定要删除吗?", "", function (data){
		if(data == 1){
			$.post("edit_projects/delete", {hid : hid}, function (data){
				if(data.success)
				{
					window.location.reload();
				}
			})
		}
	})

})




$("#add_artisan").bind("click", function(){
	window.location.href="edit_artisan";
})

$("#add_instrument").bind("click", function(){
	window.location.href="edit_instrument";
})

$("#add_projects").bind("click", function(){
	window.location.href="edit_projects";
})
</script>
</html>